package com.entfrm.biz.it.excel;

import com.baomidou.mybatisplus.annotation.TableField;
import com.entfrm.core.base.annotation.Excel;
import com.entfrm.core.base.annotation.Excels;
import com.entfrm.core.data.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;
import java.util.List;

/**
 * @author kyc
 * @date 2020-08-07 17:56:35
 * @description 资产信息对象 Property
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class PropertyExcel extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    private Integer id;

    @Excel(name = "序号")
    private Integer index;

    /**
     * 资产编号
     */
    @Excel(name = "资产编号")
    private String cowinNum;

    /** 资产品牌 */
    @Excel(name = "资产品牌")
    private String brand;

    /** 资产型号 */
    @Excel(name = "资产型号")
    private String modelNum;

    /** 资产规格 */
    @Excel(name = "资产规格")
    private String specification;

    /** 序列号 */
    @Excel(name = "序列号")
    private String serialNum;

    /** 硬盘容量 */
    @Excel(name = "硬盘容量")
    private String hardDriveCapacity;

    /** 内存容量 */
    @Excel(name = "内存容量")
    private String memoryCapacity;

    /** CPU */
    @Excel(name = "CPU")
    private String cpu;

    /** 入库时间 */
    @Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date inTime;

    /** 使用年限 */
    @Excel(name = "使用年限")
    private String workingLife;

    /** 资产分类id */
    private Integer categoryId;

    /** 资产分类父级id */
    private String categoryIds;

    @Excel(name = "分类")
    private String categoryName;

    /** 所属位置 */
    @Excel(name = "所属位置")
    private String location;

    /** 备注 */
    @Excel(name = "备注")
    private String remarks;

    /** 资产状态 */
    @Excel(name = "资产状态",convertExp = "IN_STOCK=在库,IN_USE=在用,WAIT_SCRAP=待报废,IN_SERVICE=维修中")
    private String status;

    /**
     * 使用记录列表
     */
    @Excels({
            @Excel(name = "使用人", targetAttr = "username", type = Excel.Type.EXPORT),
            @Excel(name = "工号", targetAttr = "jobId", type = Excel.Type.EXPORT),
            @Excel(name = "一级部门", targetAttr = "firstDeptName", type = Excel.Type.EXPORT),
            @Excel(name = "二级部门", targetAttr = "secondDeptName", type = Excel.Type.EXPORT),
            @Excel(name = "三级部门", targetAttr = "thirdDeptName", type = Excel.Type.EXPORT),
            @Excel(name = "领取时间", targetAttr = "receiveTime", type = Excel.Type.EXPORT, dateFormat = "yyyy-MM-dd"),
            @Excel(name = "归还时间", targetAttr = "backTime", type = Excel.Type.EXPORT, dateFormat = "yyyy-MM-dd"),
    })
    private PropertyRecordExcel propertyRecordExcel = new PropertyRecordExcel();

    @Override
    public void setRemarks(String remarks) {
        super.remarks = remarks;
    }

}
